using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class gameManager : MonoBehaviour
{

    public static gameManager instance;
    public Inveotory inveotory;
    public List<GameObject> coinBirth=new List<GameObject>();
    public List<GameObject> pointBirth = new List<GameObject>();
    public List<GameObject> monsterBirth = new List<GameObject>();
    //public Inveotory inveotory;

    private void Awake()
    {
         if (instance == null)
            instance = this;
    }
    // Start is called before the first frame update
    void Start()
    {
        EventCenter.GetInstance().EventTrigger("BirthRandomInit");
       
    }

    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Q))
        {
            InveotoryManager.GetInstance().ChangeCurrentIndex(inveotory, -1);
        }
        if (Input.GetKeyDown(KeyCode.E))
        {
            InveotoryManager.GetInstance().ChangeCurrentIndex(inveotory, 1);
        }
        if (Input.GetKeyDown(KeyCode.Space))
        {
            InveotoryManager.GetInstance().UseCurrentItem(inveotory);
        }
    }


    public void birthInit(typeOfBirth type,GameObject @object)
    {
        if (type == typeOfBirth.coin)
        {
            coinBirth.Add(@object);
        }
        if (type == typeOfBirth.monster)
        {
            monsterBirth.Add(@object);
        }
        if (type == typeOfBirth.point)
        {
            pointBirth.Add(@object);
        }

    }
}
